"use strict";
/**
 * desc：
 * author：王文军
 * date：  2022/4/7 07:56
 */
const fs = require("fs");
const path = require("path");
const userHome = require("user-home");
const dotenv = require("dotenv");
// 把当前根目录下的环境变量.env文件了里面的内容序列化到node的环境变量中
dotenv.config();

/** MONGODB **/
const MONGO_ROOT = process.env.MONGO_INITDB_ROOT_USERNAME;
const MONGO_PASSWORD = process.env.MONGO_INITDB_ROOT_PASSWORD;
const MONGODB_IP = process.env.SERVER_BASE_ONE_IP;
const mongodbUrl = `mongodb://${MONGO_ROOT}:${MONGO_PASSWORD}@${MONGODB_IP}:27018/wenjun-cli?authSource=admin`;
const mongodbDbName = "wenjun-cli";
module.exports = {
  mongodbUrl,
  mongodbDbName,
};

/** OSS **/
const OSS_ACCESS_KEY = process.env.ALI_ACCESS_KEY_ID;
const OSS_ACCESS_SECRET_KEY = process.env.ALI_ACCESS_KEY_SECRET;
const OSS_PROD_BUCKET = "wenjun-cli";
const OSS_DEV_BUCKET = "wenjun-cli-dev";
const OSS_COMPONENT_BUCKET = "wenjun-component";
const OSS_REGION = "oss-cn-chengdu";

/** MYSQL **/
const MYSQL_HOST = process.env.SERVER_BASE_TWO_IP;
const MYSQL_PORT = process.env.MYSQL_PORT;
const MYSQL_USER = process.env.MYSQL_ROOT;
const MYSQL_PWD = process.env.MYSQL_PWD;
const MYSQL_DB = process.env.MYSQL_DB;

/** REDIS **/
const REDIS_HOST = process.env.SERVER_BASE_ONE_IP;
const REDIS_PORT = process.env.REDIS_PORT;
const REDIS_PWD = process.env.REDIS_PWD;

module.exports = {
  mongodbUrl,
  mongodbDbName,
  OSS_ACCESS_KEY,
  OSS_ACCESS_SECRET_KEY,
  OSS_PROD_BUCKET,
  OSS_DEV_BUCKET,
  OSS_COMPONENT_BUCKET,
  OSS_REGION,
  MYSQL_HOST,
  MYSQL_PORT,
  MYSQL_USER,
  MYSQL_PWD,
  MYSQL_DB,
  REDIS_PORT,
  REDIS_HOST,
  REDIS_PWD,
};
